#pragma once
#include <Windows.h>
#include <string>
using namespace std;

class _Console
{
private:
	HANDLE Output;
public:
	_Console(){
		AllocConsole();
		Output = GetStdHandle(STD_OUTPUT_HANDLE);
	}
	~_Console(){
		FreeConsole();
	};
	void EndLine() {
		WriteConsole(Output,"\n",1,NULL,NULL);
	}
	void Print(string str){
		WriteConsole(Output,str.c_str(),str.length(),NULL,NULL);
		EndLine();
	}
	void Print(char * cstring)
	{
		int i = strlen(cstring);
		WriteConsole(Output,cstring,i,NULL,NULL);
		EndLine();
	}
	void Print(char c) {
		WriteConsole(Output,&c,1,NULL,NULL);
		EndLine();
	}
	void Print(int i) {
		char buffer[32];
		_itoa_s(i,buffer,10);
		Print(buffer);		
	}
};